home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / nrpas13.arc / CHEBEV.PAS < prev    next >
Pascal/Delphi Source File  |  1991-05-01  |  530b  |  22 lines

  1. FUNCTION chebev(a,b: real; c: glcarray; m: integer; x:real): real;
  2. (* Programs using routine CHEBEV must define the type
  3. glcarray as in routine CHEBFT. *)
  4. VAR
  5.    d,dd,sv,y,y2: real;
  6.    j: integer;
  7. BEGIN
  8.    IF  (((x-a)*(x-b)) > 0.0) THEN BEGIN
  9.       writeln('pause in CHEBEV - x not in range.'); readln
  10.    END;
  11.    d := 0.0;
  12.    dd := 0.0;
  13.    y := (2.0*x-a-b)/(b-a);
  14.    y2 := 2.0*y;
  15.    FOR j := m DOWNTO 2 DO BEGIN
  16.       sv := d;
  17.       d := y2*d-dd+c[j];
  18.       dd := sv
  19.    END;
  20.    chebev := y*d-dd+0.5*c[1]
  21. END;
  22.